Skip to content

Rework Code Base for Single Instance - #1583

Open
JVickery-TBS wants to merge 222 commits into
masterfrom
feature/single-instance
Open

Rework Code Base for Single Instance#1583
JVickery-TBS wants to merge 222 commits into
masterfrom
feature/single-instance

Conversation

@JVickery-TBS

Copy link
Copy Markdown
Contributor

No description provided.

- Tearing out all unnecessary code.
- Tearing out all unnecessary code.
# Conflicts:
#	ckanext/canada/tests/test_trim_package.py
### RESOLVED.
# Conflicts:
#	ckanext/canada/tests/test_trim_package.py
### RESOLVED.
@codecov

codecov Bot commented Oct 7, 2025

Copy link
Copy Markdown

❌ 4 Tests Failed:

Tests completed Failed Passed Skipped
322 4 318 0
View the top 3 failed test(s) by shortest run time
ckanext/canada/tests/test_service.py::TestStdService::test_required_fields
Stack Traces | 0.584s run time
self = <ckanext.canada.tests.test_service.TestStdService object at 0x7fddd3f9d550>

    def test_required_fields(self):
        """
        Excluding required fields should raise an exception
        """
        self._make_parent_record()
        chromo = get_chromo('service-std')
        record = chromo['examples']['record'].copy()
    
        expected_required_fields = ['service_standard_en', 'service_standard_fr',
                                    'type', 'channel', 'standards_targets_uri_en',
                                    'standards_targets_uri_fr']
    
        for field in chromo['fields']:
            if field['datastore_id'] in chromo['datastore_primary_key']:
                continue
            if field.get('excel_required') or field.get('form_required'):
>               assert field['datastore_id'] in expected_required_fields
E               AssertionError: assert 'service_name_en' in ['service_standard_en', 'service_standard_fr', 'type', 'channel', 'standards_targets_uri_en', 'standards_targets_uri_fr']

.../canada/tests/test_service.py:595: AssertionError
ckanext/canada/tests/test_service.py::TestService::test_max_chars
Stack Traces | 0.587s run time
self = <ckanext.canada.tests.test_service.TestService object at 0x7fddd3fa2790>

    def test_max_chars(self):
        """
        Over max character field values should raise an exception
        """
        chromo = get_chromo('service')
        record = chromo['examples']['record'].copy()
    
        expect_maxchar_fields = ['service_description_en', 'service_description_fr',
                                 'automated_decision_system_description_en',
                                 'automated_decision_system_description_fr',
                                 'os_comments_client_interaction_en',
                                 'os_comments_client_interaction_fr',
                                 'special_remarks_en', 'special_remarks_fr',
                                 'service_uri_en', 'service_uri_fr']
    
        for field in chromo['fields']:
            if field.get('max_chars'):
>               assert field['datastore_id'] in expect_maxchar_fields
E               AssertionError: assert 'service_name_en' in ['service_description_en', 'service_description_fr', 'automated_decision_system_description_en', 'automated_decision_system_description_fr', 'os_comments_client_interaction_en', 'os_comments_client_interaction_fr', ...]

.../canada/tests/test_service.py:406: AssertionError
ckanext/canada/tests/test_service.py::TestStdService::test_max_chars
Stack Traces | 0.647s run time
self = <ckanext.canada.tests.test_service.TestStdService object at 0x7fba4802c730>

    def test_max_chars(self):
        """
        Over max character field values should raise an exception
        """
        self._make_parent_record()
        chromo = get_chromo('service-std')
        record = chromo['examples']['record'].copy()
    
        expect_maxchar_fields = ['service_standard_en', 'service_standard_fr',
                                 'channel_comments_en', 'channel_comments_fr',
                                 'comments_en', 'comments_fr',
                                 'standards_targets_uri_en',
                                 'standards_targets_uri_fr',
                                 'performance_results_uri_en',
                                 'performance_results_uri_fr']
    
        for field in chromo['fields']:
            if field.get('max_chars'):
>               assert field['datastore_id'] in expect_maxchar_fields
E               AssertionError: assert 'service_name_en' in ['service_standard_en', 'service_standard_fr', 'channel_comments_en', 'channel_comments_fr', 'comments_en', 'comments_fr', ...]

.../canada/tests/test_service.py:767: AssertionError
ckanext/canada/tests/test_service.py::TestService::test_required_fields
Stack Traces | 0.689s run time
self = <ckanext.canada.tests.test_service.TestService object at 0x7f28b1694ca0>

    def test_required_fields(self):
        """
        Excluding required fields should raise an exception
        """
        chromo = get_chromo('service')
        record = chromo['examples']['record'].copy()
    
        expected_required_fields = ['service_description_en', 'service_description_fr',
                                    'service_type', 'service_recipient_type',
                                    'service_scope', 'client_target_groups',
                                    'program_id', 'client_feedback_channel',
                                    'automated_decision_system', 'service_fee',
                                    'os_account_registration', 'os_authentication',
                                    'os_application', 'os_decision', 'os_issuance',
                                    'os_issue_resolution_feedback', 'sin_usage',
                                    'cra_bn_identifier_usage', 'num_phone_enquiries',
                                    'num_applications_by_phone', 'num_website_visits',
                                    'num_applications_online', 'num_applications_in_person',
                                    'num_applications_by_mail', 'num_applications_by_email',
                                    'num_applications_by_fax', 'num_applications_by_other']
    
        for field in chromo['fields']:
            if field['datastore_id'] in chromo['datastore_primary_key']:
                continue
            if field.get('excel_required') or field.get('form_required'):
>               assert field['datastore_id'] in expected_required_fields
E               AssertionError: assert 'service_name_en' in ['service_description_en', 'service_description_fr', 'service_type', 'service_recipient_type', 'service_scope', 'client_target_groups', ...]

.../canada/tests/test_service.py:119: AssertionError

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

- Syntax fixes.
- Typing fixes.
- Started working on the dataset visibility validator.
- Added more validation to portal release date field.
- Changed the published search facet to capacity.
- Set capacity=private for non standard dataset types.
- After validator for dataset visibility.
- Added more sysadmin UI for user publishing perms.
- Side effect free.
- Removed geozoom.
- Fix different logic for single instance.
- Fix different logic for single instance.
- Force True for non portal package types.
- Override activity stuff for logged out users to show a dummy user.
- Minor template UI fixes.
- Added UI for private/public packages.
- Removed old logic methods.
- Removed anon actions.
- Use fq_list instead of complicated fq for package search.
- Handled remaining search issues between registry and portal.
- Added helper cli subcommand to set non portal package types to private.
- Added more bootstrap4+ classes.
- Improved some code.
- Language switcher for language domains.
- Minor remplate fixes.
- Pinned required dependency versions.
- Try/catch for dataset search.
- Flake8 fix.
@JVickery-TBS
JVickery-TBS marked this pull request as ready for review October 17, 2025 14:54

@wardi wardi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, just a few minor suggestions

Comment thread ckanext/canada/auth.py Outdated
Comment thread ckanext/canada/migration/canada_public/versions/3918d33c5c7f_.py Outdated
Comment thread ckanext/canada/schemas/presets.yaml Outdated
Comment thread ckanext/canada/templates/base.html Outdated
Comment thread ckanext/canada/templates/user/edit_user_form.html Outdated
Comment thread ckanext/canada/templates/user/list.html Outdated
# Conflicts:
#	ckanext/canada/tests/test_webforms.py
### RESOLVED.
# Conflicts:
#	.github/workflows/pytest.yml
#	ckanext/canada/assets/public/canada_public.css
### RESOLVED.
# Conflicts:
#	ckanext/canada/assets/public/canada_public.css
### RESOLVED.
- Bypass validation during migrations.
# Conflicts:
#	ckanext/canada/assets/datatables/pd_datatable.css
#	ckanext/canada/assets/public/canada_public.css
#	ckanext/canada/helpers.py
#	ckanext/canada/logic.py
#	ckanext/canada/migration/canada_logic/versions/004_28a9be077875_create_ref_data_hash_tables.py
#	ckanext/canada/model.py
#	ckanext/canada/pd.py
#	ckanext/canada/plugin/internal_plugin.py
### RESOLVED.
- Flake8 fixes.
- Added script to warn of leaving canada.ca domainspace.
- Added change log file.
# Conflicts:
#	ckanext/canada/plugin/form_plugin.py
#	ckanext/canada/validators.py
### RESOLVED.
- Allow for javascript protocols.
- Add inline styles for drupal and django.
- Bring back service names.
- Fix truncating ref data tables.
- Add command option to ignore file hashes.
- Allow for javascript protocols.
- Add inline styles for drupal and django.
- Form prefix code for service_id fields.
# Conflicts:
#	ckanext/canada/assets/datatables/source/pd_datatables.js
### RESOLVED.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants